

#ifndef STATIC_HPP_
#define STATIC_HPP_
#include <initializer_list>
#include <cassert>
template <typename T, int D>
class VarArray
{
  private:
    long dim[D]{};
    T *elem;

  public:
    VarArray(std::initializer_list<long> dimList);
    template <int DD>
    long Dim() const
    {
        static_assert(DD < D, "dddddd");
        return dim[DD];
    }
};

template <typename T, int D>
VarArray<T, D>::VarArray(std::initializer_list<long> dimList)
{
    assert(D == dimList.size());
    int size = dimList.size();
    const long *beg = dimList.begin();
    for (int i = 0; i < size; ++i)
        dim[i] = *beg++;
}

#endif